package com.ba.security.services;

import java.util.List;

import com.ba.security.entities.Permission;
import com.ba.security.entities.Role;
import com.ba.security.entities.User;
import com.ba.security.entities.Role.RoleType;

public interface UserService {
    
    /**
     * <p>
     * 根据用户名获取用户信息
     * </p>
     * @param userName
     * @return
     * @since 8.0.1
     */
    User getUserByUserName(String loginname);
    
    /**
     * <p>
     * 添加用户
     * </p>
     * @param user
     * @return
     * @since 8.0.1
     */
    public boolean addUser(User user,RoleType roleType);
    
    /**
     * <p>
     * 根据用户Id 获取用户角色
     * </p>
     * @param id
     * @return
     * @since 8.0.1
     */
    public List<Role> selectRoleByUserId(Integer id);
    
    /**
     * <p>
     * 根据用户Id获取权限
     * </p>
     * @param id
     * @return
     * @since 8.0.1
     */
    public List<Permission> selectPermissionByUserId(Integer id);

}
